package com.publiccms.entities.cms;

// Generated 2016-1-19 11:28:06 by Hibernate Tools 4.3.1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.sanluan.common.source.entity.MyColumn;

/**
 * CmsPlace generated by hbm2java
 */
@Entity
@Table(name = "cms_place")
public class CmsPlace implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @MyColumn(title = "ID")
    private Long id;
    @MyColumn(title = "站点", condition = true)
    private int siteId;
    @MyColumn(title = "路径", condition = true)
    private String path;
    @MyColumn(title = "推荐用户", condition = true)
    private long userId;
    @MyColumn(title = "项目类型", condition = true)
    private String itemType;
    @MyColumn(title = "项目ID", condition = true)
    private Integer itemId;
    @MyColumn(title = "标题")
    private String title;
    @MyColumn(title = "地址")
    private String url;
    @MyColumn(title = "封面图")
    private String cover;
    @MyColumn(title = "创建日期", order = true)
    private Date createDate;
    @MyColumn(title = "发布日期", condition = true, order = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publishDate;
    @MyColumn(title = "状态", condition = true)
    private int status;
    @MyColumn(title = "点击数", order = true)
    private int clicks;
    @MyColumn(title = "已删除", condition = true)
    private boolean disabled;

    public CmsPlace() {
    }

    public CmsPlace(int siteId, String path, long userId, String title, Date createDate, Date publishDate, int status,
            int clicks, boolean disabled) {
        this.siteId = siteId;
        this.path = path;
        this.userId = userId;
        this.title = title;
        this.createDate = createDate;
        this.publishDate = publishDate;
        this.status = status;
        this.clicks = clicks;
        this.disabled = disabled;
    }

    public CmsPlace(int siteId, String path, long userId, String itemType, Integer itemId, String title, String url,
            String cover, Date createDate, Date publishDate, int status, int clicks, boolean disabled) {
        this.siteId = siteId;
        this.path = path;
        this.userId = userId;
        this.itemType = itemType;
        this.itemId = itemId;
        this.title = title;
        this.url = url;
        this.cover = cover;
        this.createDate = createDate;
        this.publishDate = publishDate;
        this.status = status;
        this.clicks = clicks;
        this.disabled = disabled;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "site_id", nullable = false)
    public int getSiteId() {
        return this.siteId;
    }

    public void setSiteId(int siteId) {
        this.siteId = siteId;
    }

    @Column(name = "path", nullable = false)
    public String getPath() {
        return this.path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    @Column(name = "user_id", nullable = false)
    public long getUserId() {
        return this.userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Column(name = "item_type", length = 50)
    public String getItemType() {
        return this.itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    @Column(name = "item_id")
    public Integer getItemId() {
        return this.itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    @Column(name = "title", nullable = false)
    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name = "url", length = 2048)
    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Column(name = "cover")
    public String getCover() {
        return this.cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "create_date", nullable = false, length = 19)
    public Date getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "publish_date", nullable = false, length = 19)
    public Date getPublishDate() {
        return this.publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    @Column(name = "status", nullable = false)
    public int getStatus() {
        return this.status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Column(name = "clicks", nullable = false)
    public int getClicks() {
        return this.clicks;
    }

    public void setClicks(int clicks) {
        this.clicks = clicks;
    }

    @Column(name = "disabled", nullable = false)
    public boolean isDisabled() {
        return this.disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
